-
-
Notifications
You must be signed in to change notification settings - Fork 3k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Fix qgis server fcgi response destructor #59632
base: master
Are you sure you want to change the base?
Fix qgis server fcgi response destructor #59632
Conversation
🪟 Windows buildsDownload Windows builds of this PR for testing. 🪟 Windows Qt6 buildsDownload Windows Qt6 builds of this PR for testing. |
src/server/qgsfcgiserverresponse.h
Outdated
@@ -45,11 +45,13 @@ class QgsSocketMonitoringThread: public QThread | |||
* \param isResponseFinished | |||
* \param feedback | |||
*/ | |||
QgsSocketMonitoringThread( bool *isResponseFinished, QgsFeedback *feedback ); | |||
QgsSocketMonitoringThread( QgsFeedback *feedback ); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
What about the feedback? Should it become a shared ptr now that lifetime is decoupled?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I need to check the side effects
97ebe44
to
fc27b8d
Compare
1ec44a0
to
8a62b11
Compare
…heck, ../src by default
… in QgsFcgiServerResponse
8a62b11
to
fcebbdc
Compare
…using timed_mutex
…using timed_mutex
…using timed_mutex
…using timed_mutex
for ( int i = 0; !mIsResponseFinished.load() && x2 == 0 && i < 10; i++ ) | ||
{ | ||
x2 = recv( mIpcFd, &c, 1, MSG_PEEK | MSG_DONTWAIT ); // see https://stackoverflow.com/a/12402596 | ||
std::this_thread::sleep_for( 50ms ); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Why waiting ? Is it require for synchronization?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I prefer way much this solution that the one(s) before, thanks @benoitdm-oslandia 👍
Just a few comments
Suppress wait in fcgi response destructor
In the previous version, the response destructor waited for the monitoring thread to end that may induce a 333ms sleep each time. We fix that by using a classic ptr to separate the thread and the response lifecycles.